package udp;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;


public class UDPServer {

	public static void main(String[] args) throws IOException {
		DatagramSocket socket = new DatagramSocket(5200);

		byte[] buf = new byte[1024];
		DatagramPacket packet = new DatagramPacket(buf, buf.length);
		socket.receive(packet);
		
		socket.close();
		
		System.out.printf("%s\n%s\n%d\n",
				new String(buf), packet.getAddress().getHostAddress(), packet.getPort());
	}

}
